<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // for 循环
        var my_array = [1,2,3,4];

        for (var index=0;index<my_array.length;index++){
            console.log(my_array[index]);
        }

        // while 循环
        var while_index = 0;
        while (while_index<my_array.length){
            console.log(my_array[while_index]);
            while_index++;
        }


        // do while 循环
        var while_index_2 = 0;
        do{
            console.log(my_array[while_index_2]);
            while_index_2++;
        }while(while_index_2<while_index_2.length)
    </script>
</head>
<body>
    
</body>
</html>